package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {
    @Select("select * from user where openid = #{openId}")
    User selectByOpenId(String openID);


    void insert(User user);

    @Select("select * from user where id=#{userId}")
    User selectById(Long userId);

    /**
     * 根据动态条件统计用户数量
     * @param beginTime
     * @param endTime
     * @return
     */
    Integer selectUserTotalByTime(LocalDateTime beginTime, LocalDateTime endTime);
}
